package com.hy.controller;

import com.hy.pojo.Province;
import com.hy.service.ProvinceService;
import com.hy.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("province")
public class ProvinceController {
    @Autowired
    ProvinceService provinceService;

    @RequestMapping("findProvinces")
    public Result findProvinces(){
        List<Province> list = provinceService.findProvinces();
        return Result.success( "查询成功", list);
    }

    @RequestMapping("findProvince")
    public Result findProvince(){
        List< Province> list = provinceService.findProvince();
        return Result.success( "查询成功", list);
    }
}
